from albertv0 import *


class Action(object):
    CLIP_ACTION = 1
    URL_ACTION = 2
    PROC_ACTION = 3
    TERM_ACTION = 4

    def __get_action_internal(self, action_type, show_msg, params):
        if action_type == self.CLIP_ACTION:
            return ClipAction(show_msg, params)
        if action_type == self.URL_ACTION:
            return UrlAction(show_msg, params)
        if action_type == self.PROC_ACTION:
            return ProcAction(show_msg, params)
        if action_type == self.TERM_ACTION:
            return TermAction(show_msg, params)
        raise Exception('action type error')
        pass

    @classmethod
    def get_action(cls, action_type, show_msg, params):
        this = cls()
        return this.__get_action_internal(action_type, show_msg, params)
        pass

    pass
